package edu.sctu.practice.class02.xuqianlan.test.test18;

/**
 * Created by lenovo on 2015/10/29.
 */
public class Auto {
    public int tire;
    public String color;
    public int weight;
    public int speed;

    public Auto(int tire) {
        this.tire = tire;
    }

    public Auto(int tire, int weight, String color, int speed) {
        this.tire = tire;
        this.weight = weight;
        this.color = color;
        this.speed = speed;
        System.out.println("轮子："+tire+" 自重："+weight+"kg 颜色:"+color+" 速度："+speed+"km/h");
    }

    public void upSpeed() {
        speed += 5;
        System.out.println("加速后汽车的速度为：" + speed + "km/h");

    }

    public void downSpeed() {
        speed -= 5;
        System.out.println("减速后汽车的速度为：" + speed + "km/h");
    }

    public void stop() {
        System.out.println("汽车已停止。");
    }

}


